package top.dingyingying.springboot3.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import top.dingyingying.springboot3.validate.CommonValidate;

import java.io.Serial;
import java.io.Serializable;

@Data
//实体类对应的表名称
@TableName("tb_contact")
public class TbContact implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer uid;
    private String username;
    @Pattern(message = "手机号格式不正确", regexp = CommonValidate.PHONE)
    private String phone;
    @Pattern(message = "邮箱格式不正确", regexp = CommonValidate.EMAIL)
    private String email;
    private String address;


    }
